package com.jyxd.web.controller.patient;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jyxd.web.data.common.Result;
import com.jyxd.web.data.patient.PatientTransferInfo;
import com.jyxd.web.service.patient.IPatientTransferInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 患者流转信息 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2022-09-20
 */
@RestController
@RequestMapping("/patientTransferInfo")
public class PatientTransferInfoController {
    @Autowired
    private IPatientTransferInfoService patientTransferInfoService;

    @RequestMapping("/queryList/{patientId}")
    public Result<?> queryList(@PathVariable("patientId") String patientId) {
        Wrapper<PatientTransferInfo> wrapper = new QueryWrapper<PatientTransferInfo>().eq("patient_id",patientId).orderByAsc("data_time");
        List<PatientTransferInfo> list = patientTransferInfoService.list(wrapper);
        return Result.succeed(list);
    }
}
